In a data network, it is often desirable to set limits on the amount of storage that can be allocated to a particular user, group of users, or to a directory tree in a file system. For example, the Microsoft Office (Trademark) E-mail application for networks has both a soft limit and a hard limit on the size of a user's mailbox on a server. If the total storage consumed by all of the files in a user's mailbox exceeds the soft limit, then the user receives an E-mail saying that the user's mailbox is full, and unless some files are deleted, incoming mail might not be received. Incoming mail will not be received if the hard limit would be exceeded.
File servers have set quotas for the storage used by users and user groups. The file server maintains a quota database having an entry for each quota. For example, an entry in the quota database includes a user or user group ID, a usage value, a hard limit value, and a soft limit value. Upon receipt of a storage access request that would increase the usage, the quota database is accessed to check whether or not a hard or soft limit would be exceeded. If a soft limit would be exceeded, a warning is returned to the user. If a hard limit would be exceeded, then access is denied. If access is granted, the usage is updated.
In a file server, it is relatively easy to provide user or group ID quotas, because it is easy to index the quota database with a user or group ID. In contrast, if a quota is placed on all of the files within a directory tree, then there is an additional problem of determining whether or not a file is within a directory tree having such a quota.